package com.gbas.comu.servlet.struts;

import com.gbas.comu.dao.DaoService;
import com.gbas.comu.service.EquipoService;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.MappingDispatchAction;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class EquipoActions extends MappingDispatchAction {
    public ActionForward show(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse response) throws Exception {
        httpServletRequest.setAttribute("equipos", DaoService.getEquipoDAO().findAll());

        return actionMapping.findForward("success");
    }
    public ActionForward create(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse response) throws Exception {
        EquipoService.createEquiposYJugadoresExample();

        return actionMapping.findForward("success");
    }
}
